﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.GERP.GHRMS.MODEL;
using KPIS.GERP.GHRMS.IBLL;
using KPIS.GERP.GHRMS.IDAL;
using KPIS.GERP.GHRMS.DAL;
using System.Data;

namespace KPIS.GERP.GHRMS.BLL
{
    public class TrainingLecturerSkillsBLL : ITrainingLecturerSkillsBLL
    {
        private static readonly ITrainingLecturerSkillsDAL dal = new TrainingLecturerSkillsDAL();
        TrainingLecturerSkillsDAL CDdal = new TrainingLecturerSkillsDAL();
        ConvertNullable cn = new ConvertNullable();
        public TrainingLecturerSkillsBLL()
        {

        }
        public IList<TrainingLecturerSkillsInfo> GetFull()
        {
            return dal.GetFull();
        }
        public IList<TrainingLecturerSkillsInfo> GetBySubject(string train_seq)
        {
            Nullable<int> nTrainSeq = cn.ConvertNullInt(train_seq);
            return dal.GetBySubject(nTrainSeq);
        }

        public void Insert(TrainingLecturerSkillsInfo info)
        {
            try
            {
                dal.Insert(info);
            }
            catch
            {
                throw;
            }
        }

        public void Delete(TrainingLecturerSkillsInfo info)
        {
            try
            {
                dal.Delete(info);
            }
            catch
            {
                throw;
            }
        }
        public DataSet CheckDuplicate(string trainer_seq, string training_subject_seq)
        {
            int itrainer_seq = Convert.ToInt32(trainer_seq); 
            int itraining_subject_seq = Convert.ToInt32(training_subject_seq); 
            return CDdal.CheckDuplicate(itrainer_seq, itraining_subject_seq);
        }

        public void Update(string strTranSeq, string TranSubSeq, string TrainerCapSeq)
        {
            dal.Update(strTranSeq, TranSubSeq, TrainerCapSeq);
        }
    }
}
